﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Universum.Infrastructure.Persistence;
using Moq;
using Universum.Model.Domain.Blogs;

namespace Universum.Unit.Tests.Controllers
{
	public class with_user_logged_and_blog :with_user_logged
	{
		public Mock<IRepository> RepositoryMock;
		public IRepository Repository;
		protected override void EstablishContext()
		{
			base.EstablishContext();
			Blog blog = new Blog();
			blog.ID = Guid.NewGuid();
			blog.Name = "Hello";
			blog.Owner = Principal.Identity.Name;
			blog.Description = "Hello";
			RepositoryMock = new Mock<IRepository>();
			RepositoryMock.Setup(
				r => r.Query(
					It.IsAny<Universum.Infrastructure.Persistence.Queries.Blog.BlogByOwner>()))
					.Returns(() => new Blog[] { blog }.AsQueryable())
					.Verifiable();
			Repository = RepositoryMock.Object;
		}
	}
}
